home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Display Manager / Compiler & Runtime Files / • New universal header files • / CIncludes / Video.h < prev   
Encoding:
C/C++ Source or Header  |  1997-06-24  |  34.6 KB  |  835 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Video.h
  3.  
  4.      Contains:    Video Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces in “Display Manager Development Kit” (post ETO #18)
  8.                  Date:        12/6/96
  9.                 
  10.      Copyright:    © 1984-1996 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. */
  20.  
  21. #ifndef __VIDEO__
  22. #define __VIDEO__
  23.  
  24.  
  25. #ifndef __QUICKDRAW__
  26. #include <Quickdraw.h>
  27. #endif
  28. /*    #include <Types.h>                                            */
  29. /*        #include <ConditionalMacros.h>                            */
  30. /*    #include <MixedMode.h>                                        */
  31. /*    #include <QuickdrawText.h>                                    */
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_ALIGN_SUPPORTED
  38. #pragma options align=mac68k
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45.  
  46. enum {
  47.     mBaseOffset                    = 1,                            /*Id of mBaseOffset.*/
  48.     mRowBytes                    = 2,                            /*Video sResource parameter Id's */
  49.     mBounds                        = 3,                            /*Video sResource parameter Id's */
  50.     mVersion                    = 4,                            /*Video sResource parameter Id's */
  51.     mHRes                        = 5,                            /*Video sResource parameter Id's */
  52.     mVRes                        = 6,                            /*Video sResource parameter Id's */
  53.     mPixelType                    = 7,                            /*Video sResource parameter Id's */
  54.     mPixelSize                    = 8,                            /*Video sResource parameter Id's */
  55.     mCmpCount                    = 9,                            /*Video sResource parameter Id's */
  56.     mCmpSize                    = 10,                            /*Video sResource parameter Id's */
  57.     mPlaneBytes                    = 11,                            /*Video sResource parameter Id's */
  58.     mVertRefRate                = 14,                            /*Video sResource parameter Id's */
  59.     mVidParams                    = 1,                            /*Video parameter block id.*/
  60.     mTable                        = 2,                            /*Offset to the table.*/
  61.     mPageCnt                    = 3,                            /*Number of pages*/
  62.     mDevType                    = 4,                            /*Device Type*/
  63.     oneBitMode                    = 128,                            /*Id of OneBitMode Parameter list.*/
  64.     twoBitMode                    = 129,                            /*Id of TwoBitMode Parameter list.*/
  65.     fourBitMode                    = 130,                            /*Id of FourBitMode Parameter list.*/
  66.     eightBitMode                = 131                            /*Id of EightBitMode Parameter list.*/
  67. };
  68.  
  69. enum {
  70.     sixteenBitMode                = 132,                            /*Id of SixteenBitMode Parameter list.*/
  71.     thirtyTwoBitMode            = 133,                            /*Id of ThirtyTwoBitMode Parameter list.*/
  72.     firstVidMode                = 128,                            /*The new, better way to do the above. */
  73.     secondVidMode                = 129,                            /* QuickDraw only supports six video */
  74.     thirdVidMode                = 130,                            /* at this time.      */
  75.     fourthVidMode                = 131,
  76.     fifthVidMode                = 132,
  77.     sixthVidMode                = 133,
  78.     spGammaDir                    = 64,
  79.     spVidNamesDir                = 65
  80. };
  81.  
  82. /* csTimingFormat values in VDTimingInfo */
  83. /* look in the declaration rom for timing info */
  84. enum {
  85.     kDeclROMtables                = 'decl'
  86. };
  87.  
  88. /* Size of a block of EDID (Extended Display Identification Data) */
  89.  
  90. enum {
  91.     kDDCBlockSize                = 128
  92. };
  93.  
  94. /* ddcBlockType constants*/
  95.  
  96. enum {
  97.     kDDCBlockTypeEDID            = 0                                /* EDID block type. */
  98. };
  99.  
  100. /* ddcFlags constants*/
  101.  
  102. enum {
  103.     kDDCForceReadBit            = 0,                            /* Force a new read of the EDID. */
  104.     kDDCForceReadMask            = (1 << kDDCForceReadBit)        /* Mask for kddcForceReadBit. */
  105. };
  106.  
  107.  
  108. /* Timing mode constants for Display Manager MultiMode support
  109.     Corresponding    .h equates are in Video.h
  110.                     .a equates are in Video.a
  111.                     .r equates are in DepVideoEqu.r
  112.     
  113.     The first enum is the old names (for compatibility).
  114.     The second enum is the new names.
  115. */
  116. enum {
  117.     timingApple12                = 130,                            /*  512x384 (60 Hz) Rubik timing.*/
  118.     timingApple12x                = 135,                            /*  560x384 (60 Hz) Rubik-560 timing.*/
  119.     timingApple13                = 140,                            /*  640x480 (67 Hz) HR timing.*/
  120.     timingApple13x                = 145,                            /*  640x400 (67 Hz) HR-400 timing.*/
  121.     timingAppleVGA                = 150,                            /*  640x480  (60 Hz) VGA timing.*/
  122.     timingApple15                = 160,                            /*  640x870 (75 Hz) FPD timing.*/
  123.     timingApple15x                = 165,                            /*  640x818 (75 Hz) FPD-818 timing.*/
  124.     timingApple16                = 170,                            /*  832x624 (75 Hz) GoldFish timing.*/
  125.     timingAppleSVGA                = 180,                            /*  800x600  (56 Hz) SVGA timing.*/
  126.     timingApple1Ka                = 190,                            /* 1024x768 (60 Hz) VESA 1K-60Hz timing.*/
  127.     timingApple1Kb                = 200,                            /* 1024x768 (70 Hz) VESA 1K-70Hz timing.*/
  128.     timingApple19                = 210,                            /* 1024x768  (75 Hz) Apple 19" RGB.*/
  129.     timingApple21                = 220                            /* 1152x870  (75 Hz) Apple 21" RGB.*/
  130. };
  131.  
  132. enum {
  133.     timingInvalid                = 0,                            /*    Unknown timing… force user to confirm. */
  134.     timingInvalid_SM_T24        = 8,                            /*    Work around bug in SM Thunder24 card.*/
  135.     timingApple_FixedRateLCD    = 42,                            /*    Lump all fixed-rate LCDs into one category.*/
  136.     timingApple_512x384_60hz    = 130,                            /*  512x384  (60 Hz) Rubik timing.*/
  137.     timingApple_560x384_60hz    = 135,                            /*  560x384  (60 Hz) Rubik-560 timing.*/
  138.     timingApple_640x480_67hz    = 140,                            /*  640x480  (67 Hz) HR timing.*/
  139.     timingApple_640x400_67hz    = 145,                            /*  640x400  (67 Hz) HR-400 timing.*/
  140.     timingVESA_640x480_60hz        = 150,                            /*  640x480  (60 Hz) VGA timing.*/
  141.     timingVESA_640x480_72hz        = 152,                            /*  640x480  (72 Hz) VGA timing. */
  142.     timingVESA_640x480_75hz        = 154,                            /*  640x480  (75 Hz) VGA timing. */
  143.     timingVESA_640x480_85hz        = 158,                            /*  640x480  (85 Hz) VGA timing. */
  144.     timingGTF_640x480_120hz        = 159,                            /*  640x480  (120 Hz) VESA Generalized Timing Formula */
  145.     timingApple_640x870_75hz    = 160,                            /*  640x870  (75 Hz) FPD timing.*/
  146.     timingApple_640x818_75hz    = 165,                            /*  640x818  (75 Hz) FPD-818 timing.*/
  147.     timingApple_832x624_75hz    = 170,                            /*  832x624  (75 Hz) GoldFish timing.*/
  148.     timingVESA_800x600_56hz        = 180,                            /*  800x600  (56 Hz) SVGA timing.*/
  149.     timingVESA_800x600_60hz        = 182,                            /*  800x600  (60 Hz) SVGA timing.*/
  150.     timingVESA_800x600_72hz        = 184,                            /*  800x600  (72 Hz) SVGA timing.*/
  151.     timingVESA_800x600_75hz        = 186,                            /*  800x600  (75 Hz) SVGA timing.*/
  152.     timingVESA_800x600_85hz        = 188,                            /*  800x600  (85 Hz) SVGA timing. */
  153.     timingVESA_1024x768_60hz    = 190,                            /* 1024x768  (60 Hz) VESA 1K-60Hz timing.*/
  154.     timingVESA_1024x768_70hz    = 200,                            /* 1024x768  (70 Hz) VESA 1K-70Hz timing.*/
  155.     timingVESA_1024x768_75hz    = 204,                            /* 1024x768  (75 Hz) VESA 1K-70Hz timing (very similar to timingApple_1024x768_75hz).*/
  156.     timingVESA_1024x768_85hz    = 208,                            /* 1024x768  (85 Hz) VESA timing. */
  157.     timingApple_1024x768_75hz    = 210,                            /* 1024x768  (75 Hz) Apple 19" RGB.*/
  158.     timingApple_1152x870_75hz    = 220,                            /* 1152x870  (75 Hz) Apple 21" RGB.*/
  159.     timingAppleNTSC_ST            = 230,                            /*  512x384  (60 Hz, interlaced, non-convolved).*/
  160.     timingAppleNTSC_FF            = 232,                            /*  640x480  (60 Hz, interlaced, non-convolved).*/
  161.     timingAppleNTSC_STconv        = 234,                            /*  512x384  (60 Hz, interlaced, convolved).*/
  162.     timingAppleNTSC_FFconv        = 236,                            /*  640x480  (60 Hz, interlaced, convolved).*/
  163.     timingApplePAL_ST            = 238,                            /*  640x480  (50 Hz, interlaced, non-convolved).*/
  164.     timingApplePAL_FF            = 240,                            /*  768x576  (50 Hz, interlaced, non-convolved).*/
  165.     timingApplePAL_STconv        = 242,                            /*  640x480  (50 Hz, interlaced, convolved).*/
  166.     timingApplePAL_FFconv        = 244,                            /*  768x576  (50 Hz, interlaced, convolved).*/
  167.     timingVESA_1280x960_75hz    = 250,                            /* 1280x960  (75 Hz)*/
  168.     timingVESA_1280x960_60hz    = 252,                            /* 1280x960  (60 Hz) */
  169.     timingVESA_1280x960_85hz    = 254,                            /* 1280x960  (85 Hz) */
  170.     timingVESA_1280x1024_60hz    = 260,                            /* 1280x1024 (60 Hz)*/
  171.     timingVESA_1280x1024_75hz    = 262,                            /* 1280x1024 (75 Hz)*/
  172.     timingVESA_1280x1024_85hz    = 268,                            /* 1280x1024 (85 Hz) */
  173.     timingVESA_1600x1200_60hz    = 280,                            /* 1600x1200 (60 Hz) VESA proposed timing.*/
  174.     timingVESA_1600x1200_65hz    = 282,                            /* 1600x1200 (65 Hz) VESA proposed timing.*/
  175.     timingVESA_1600x1200_70hz    = 284,                            /* 1600x1200 (70 Hz) VESA proposed timing.*/
  176.     timingVESA_1600x1200_75hz    = 286,                            /* 1600x1200 (75 Hz) VESA proposed timing.*/
  177.     timingVESA_1600x1200_80hz    = 288,                            /* 1600x1200 (80 Hz) VESA proposed timing (pixel clock is 216 Mhz dot clock).*/
  178.     timingSMPTE240M_60hz        = 400,                            /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035.*/
  179.     timingFilmRate_48hz            = 410                            /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480.*/
  180. };
  181.  
  182. /* csConnectFlags values in VDDisplayConnectInfo */
  183. enum {
  184.     kAllModesValid                = 0,                            /* All modes not trimmed by primary init are good close enough to try */
  185.     kAllModesSafe                = 1,                            /* All modes not trimmed by primary init are know to be safe */
  186.     kReportsTagging                = 2,                            /* Can detect tagged displays (to identify smart monitors) */
  187.     kHasDirectConnection        = 3,                            /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */
  188.     kIsMonoDev                    = 4,                            /* Says whether there’s an RGB (0) or Monochrome (1) connection. */
  189.     kUncertainConnection        = 5,                            /* There may not be a display (no sense lines?). */
  190.     kTaggingInfoNonStandard        = 6,                            /* Set when csConnectTaggedType/csConnectTaggedData are non-standard (i.e., not the Apple CRT sense codes). */
  191.     kReportsDDCConnection        = 7,                            /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */
  192.     kHasDDCConnection            = 8,                            /* Card has ddc connect now. */
  193.     kConnectionInactive            = 9,                            /* Set when the connection is NOT currently active (generally used in a multiconnection environment). */
  194.     kDependentConnection        = 10,                            /* Set when some ascpect of THIS connection depends on another (will generally be set in a kModeSimulscan environment). */
  195.     kBuiltInConnection            = 11                            /* Set when connection is KNOWN to be built-in (this is not the same as kHasDirectConnection). */
  196. };
  197.  
  198. /* csDisplayType values in VDDisplayConnectInfo */
  199. enum {
  200.     kUnknownConnect                = 1,                            /* Not sure how we’ll use this, but seems like a good idea. */
  201.     kPanelConnect                = 2,                            /* For use with fixed-in-place LCD panels. */
  202.     kPanelTFTConnect            = 2,                            /* Alias for kPanelConnect */
  203.     kFixedModeCRTConnect        = 3,                            /*  For use with fixed-mode (i.e., very limited range) displays. */
  204.     kMultiModeCRT1Connect        = 4,                            /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */
  205.     kMultiModeCRT2Connect        = 5,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */
  206.     kMultiModeCRT3Connect        = 6,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */
  207.     kMultiModeCRT4Connect        = 7,                            /* Expansion to large multi mode (not yet used) */
  208.     kModelessConnect            = 8,                            /* Expansion to modeless model (not yet used) */
  209.     kFullPageConnect            = 9,                            /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */
  210.     kVGAConnect                    = 10,                            /* 640x480 VGA default -- question everything else */
  211.     kNTSCConnect                = 11,                            /* NTSC ST (default), FF, STconv, FFconv */
  212.     kPALConnect                    = 12,                            /* PAL ST (default), FF, STconv, FFconv */
  213.     kHRConnect                    = 13,                            /* Straight-6 connect -- 640x480 and 640x400 (to get 8bpp in 256K case) (these two only) */
  214.     kPanelFSTNConnect            = 14,                            /* For use with fixed-in-place LCD FSTN (aka “Supertwist”) panels */
  215.     kMonoTwoPageConnect            = 15,                            /* 1152x870 Apple color two-page display */
  216.     kColorTwoPageConnect        = 16,                            /* 1152x870 Apple B&W two-page display */
  217.     kColor16Connect                = 17,                            /* 832x624 Apple B&W two-page display */
  218.     kColor19Connect                = 18,                            /* 1024x768 Apple B&W two-page display */
  219.     kGenericCRT                    = 19,                            /* Indicates nothing except that connection is CRT in nature. */
  220.     kGenericLCD                    = 20,                            /* Indicates nothing except that connection is LCD in nature. */
  221.     kDDCConnect                    = 21                            /* DDC connection, always set kHasDDCConnection */
  222. };
  223.  
  224. /* csTimingFlags values in VDTimingInfoRec */
  225. enum {
  226.     kModeValid                    = 0,                            /* Says that this mode should NOT be trimmed. */
  227.     kModeSafe                    = 1,                            /* This mode does not need confirmation */
  228.     kModeDefault                = 2,                            /* This is the default mode for this type of connection */
  229.     kModeShowNow                = 3,                            /* This mode should always be shown (even though it may require a confirm) */
  230.     kModeNotResize                = 4,                            /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */
  231.     kModeRequiresPan            = 5,                            /* This mode has more pixels than are actually displayed */
  232.     kModeInterlaced                = 6,                            /* This mode is interlaced (single pixel lines look bad). */
  233.     kModeShowNever                = 7,                            /* This mode should not be shown in the user interface. */
  234.     kModeSimulscan                = 8,                            /* Indicates that more than one display connection can be driven from a single framebuffer controller. */
  235.     kModeNotPreset                = 9,                            /* Indicates that the timing is not a factory preset for the current display (geometry may need correction) */
  236.     kModeBuiltIn                = 10                            /* Indicates that the display mode is for the built-in connect only (on multiconnect devices like the PB 3400) Only the driver is quieried */
  237. };
  238.  
  239. /* csResolutionFlags bit flags for VDResolutionInfoRec */
  240. enum {
  241.     kDepthDependent                = 0                                /* Says that this depth mode may cause dependent changes in other framebuffers (and . */
  242. };
  243.  
  244. enum {
  245.     kResolutionHasMultipleDepthSizes = 0                        /* Says that this mode has different csHorizontalPixels, csVerticalLines at different depths (usually slightly larger at lower depths) */
  246. };
  247.  
  248. enum {
  249. /*    Power Mode constants for VDPowerStateRec.powerState.    */
  250.     kAVPowerOff,
  251.     kAVPowerStandby,
  252.     kAVPowerSuspend,
  253.     kAVPowerOn
  254. };
  255.  
  256. enum {
  257. /*    Power Mode masks and bits for VDPowerStateRec.powerFlags.    */
  258.     kPowerStateNeedsRefresh        = 0,
  259.     kPowerStateNeedsRefreshMask    = (1L << 0)
  260. };
  261.  
  262. enum {
  263. /* Control Codes */
  264.     cscReset                    = 0,
  265.     cscKillIO                    = 1,
  266.     cscSetMode                    = 2,
  267.     cscSetEntries                = 3,
  268.     cscSetGamma                    = 4,
  269.     cscGrayPage                    = 5,
  270.     cscGrayScreen                = 5,
  271.     cscSetGray                    = 6,
  272.     cscSetInterrupt                = 7,
  273.     cscDirectSetEntries            = 8,
  274.     cscSetDefaultMode            = 9,
  275.     cscSwitchMode                = 10,
  276.     cscSetSync                    = 11,
  277.     cscSavePreferredConfiguration = 16,
  278.     cscSetHardwareCursor        = 22,
  279.     cscDrawHardwareCursor        = 23,
  280.     cscSetConvolution            = 24,
  281.     cscSetPowerState            = 25,
  282.     cscPrivateControlCall        = 26,                            /* Takes a VDPrivateSelectorDataRec*/
  283.     cscSetMultiConnect            = 28,                            /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/
  284.     cscSetClutBehavior            = 29,                            /* Takes a VDClutBehavior */
  285.     cscUnusedCall                = 127                            /* This call used to expend the scrn resource.  Its imbedded data contains more control info */
  286. };
  287.  
  288. enum {
  289. /* Status Codes */
  290.     cscGetMode                    = 2,
  291.     cscGetEntries                = 3,
  292.     cscGetPageCnt                = 4,
  293.     cscGetPages                    = 4,                            /* This is what C&D 2 calls it. */
  294.     cscGetPageBase                = 5,
  295.     cscGetBaseAddr                = 5,                            /* This is what C&D 2 calls it. */
  296.     cscGetGray                    = 6,
  297.     cscGetInterrupt                = 7,
  298.     cscGetGamma                    = 8,
  299.     cscGetDefaultMode            = 9,
  300.     cscGetCurMode                = 10,
  301.     cscGetSync                    = 11,
  302.     cscGetConnection            = 12,                            /* Return information about the connection to the display */
  303.     cscGetModeTiming            = 13,                            /* Return timing info for a mode */
  304.     cscGetModeBaseAddress        = 14,                            /* Return base address information about a particular mode */
  305.     cscGetScanProc                = 15,                            /* QuickTime scan chasing routine */
  306.     cscGetPreferredConfiguration = 16,
  307.     cscGetNextResolution        = 17,
  308.     cscGetVideoParameters        = 18,
  309.     cscGetGammaInfoList            = 20,
  310.     cscRetrieveGammaTable        = 21,
  311.     cscSupportsHardwareCursor    = 22,
  312.     cscGetHardwareCursorDrawState = 23,
  313.     cscGetConvolution            = 24,
  314.     cscGetPowerState            = 25,
  315.     cscPrivateStatusCall        = 26,                            /* Takes a VDPrivateSelectorDataRec*/
  316.     cscGetDDCBlock                = 27,                            /* Takes a VDDDCBlockRec  */
  317.     cscGetMultiConnect            = 28,                            /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/
  318.     cscGetClutBehavior            = 29                            /* Takes a VDClutBehavior */
  319. };
  320.  
  321. /* Bit definitions for the Get/Set Sync call*/
  322. enum {
  323.     kDisableHorizontalSyncBit    = 0,
  324.     kDisableVerticalSyncBit        = 1,
  325.     kDisableCompositeSyncBit    = 2,
  326.     kEnableSyncOnBlue            = 3,
  327.     kEnableSyncOnGreen            = 4,
  328.     kEnableSyncOnRed            = 5,
  329.     kNoSeparateSyncControlBit    = 6,
  330.     kTriStateSyncBit            = 7,
  331.     kHorizontalSyncMask            = 0x01,
  332.     kVerticalSyncMask            = 0x02,
  333.     kCompositeSyncMask            = 0x04,
  334.     kDPMSSyncMask                = 0x07,
  335.     kTriStateSyncMask            = 0x80,
  336.     kSyncOnBlueMask                = 0x08,
  337.     kSyncOnGreenMask            = 0x10,
  338.     kSyncOnRedMask                = 0x20,
  339.     kSyncOnMask                    = 0x38
  340. };
  341.  
  342. enum {
  343. /*    Power Mode constants for translating DPMS modes to Get/SetSync calls.    */
  344.     kDPMSSyncOn                    = 0,
  345.     kDPMSSyncStandby            = 1,
  346.     kDPMSSyncSuspend            = 2,
  347.     kDPMSSyncOff                = 7
  348. };
  349.  
  350. enum {
  351.     kConvolved                    = 0,
  352.     kLiveVideoPassThru            = 1,
  353.     kConvolvedMask                = 0x01,
  354.     kLiveVideoPassThruMask        = 0x02
  355. };
  356.  
  357. struct VPBlock {
  358.     long                            vpBaseOffset;                /*Offset to page zero of video RAM (From minorBaseOS).*/
  359.     short                            vpRowBytes;                    /*Width of each row of video memory.*/
  360.     Rect                            vpBounds;                    /*BoundsRect for the video display (gives dimensions).*/
  361.     short                            vpVersion;                    /*PixelMap version number.*/
  362.     short                            vpPackType;
  363.     long                            vpPackSize;
  364.     long                            vpHRes;                        /*Horizontal resolution of the device (pixels per inch).*/
  365.     long                            vpVRes;                        /*Vertical resolution of the device (pixels per inch).*/
  366.     short                            vpPixelType;                /*Defines the pixel type.*/
  367.     short                            vpPixelSize;                /*Number of bits in pixel.*/
  368.     short                            vpCmpCount;                    /*Number of components in pixel.*/
  369.     short                            vpCmpSize;                    /*Number of bits per component*/
  370.     long                            vpPlaneBytes;                /*Offset from one plane to the next.*/
  371. };
  372. typedef struct VPBlock VPBlock;
  373.  
  374. typedef VPBlock *VPBlockPtr;
  375.  
  376. struct VDEntryRecord {
  377.     Ptr                                csTable;                    /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
  378. };
  379. typedef struct VDEntryRecord VDEntryRecord;
  380.  
  381. typedef VDEntryRecord *VDEntRecPtr;
  382.  
  383. /* Parm block for SetGray control call */
  384. struct VDGrayRecord {
  385.     Boolean                            csMode;                        /*Same as GDDevType value (0=color, 1=mono)*/
  386.     SInt8                            filler;
  387. };
  388. typedef struct VDGrayRecord VDGrayRecord;
  389.  
  390. typedef VDGrayRecord *VDGrayPtr;
  391.  
  392. /* Parm block for SetInterrupt call */
  393. struct VDFlagRecord {
  394.     SInt8                            csMode;
  395.     SInt8                            filler;
  396. };
  397. typedef struct VDFlagRecord VDFlagRecord;
  398.  
  399. typedef VDFlagRecord *VDFlagRecPtr;
  400.  
  401. /* Parm block for SetEntries control call */
  402. struct VDSetEntryRecord {
  403.     ColorSpec                        *csTable;                    /*Pointer to an array of color specs*/
  404.     short                            csStart;                    /*Which spec in array to start with, or -1*/
  405.     short                            csCount;                    /*Number of color spec entries to set*/
  406. };
  407. typedef struct VDSetEntryRecord VDSetEntryRecord;
  408.  
  409. typedef VDSetEntryRecord *VDSetEntryPtr;
  410.  
  411. /* Parm block for SetGamma control call */
  412. struct VDGammaRecord {
  413.     Ptr                                csGTable;                    /*pointer to gamma table*/
  414. };
  415. typedef struct VDGammaRecord VDGammaRecord;
  416.  
  417. typedef VDGammaRecord *VDGamRecPtr;
  418.  
  419. struct VDBaseAddressInfoRec {
  420.     long                            csDevData;                    /* LONGINT - (long) timing mode */
  421.     long                            csDevBase;                    /* LONGINT - (long) base address of the mode */
  422.     short                            csModeReserved;                /* INTEGER - (short) will some day be the depth */
  423.     long                            csModeBase;                    /* LONGINT - (long) reserved */
  424. };
  425. typedef struct VDBaseAddressInfoRec VDBaseAddressInfoRec, *VDBaseAddressInfoPtr;
  426.  
  427. struct VDSwitchInfoRec {
  428.     unsigned short                    csMode;                        /*(word) mode depth*/
  429.     unsigned long                    csData;                        /*(long) functional sResource of mode*/
  430.     unsigned short                    csPage;                        /*(word) page to switch in*/
  431.     Ptr                                csBaseAddr;                    /*(long) base address of page (return value)*/
  432.     unsigned long                    csReserved;                    /*(long) Reserved (set to 0) */
  433. };
  434. typedef struct VDSwitchInfoRec VDSwitchInfoRec;
  435.  
  436. typedef VDSwitchInfoRec *VDSwitchInfoPtr;
  437.  
  438. struct VDTimingInfoRec {
  439.     unsigned long                    csTimingMode;                /* LONGINT - (long) timing mode (a la InitGDevice) */
  440.     unsigned long                    csTimingReserved;            /* LONGINT - (long) reserved */
  441.     unsigned long                    csTimingFormat;                /* LONGINT - (long) what format is the timing info */
  442.     unsigned long                    csTimingData;                /* LONGINT - (long) data supplied by driver */
  443.     unsigned long                    csTimingFlags;                /* LONGINT - (long) mode within device */
  444. };
  445. typedef struct VDTimingInfoRec VDTimingInfoRec;
  446.  
  447. typedef VDTimingInfoRec *VDTimingInfoPtr;
  448.  
  449. struct VDDisplayConnectInfoRec {
  450.     unsigned short                    csDisplayType;                /* INTEGER - (word) Type of display connected */
  451.     unsigned char                    csConnectTaggedType;        /* BYTE - type of tagging */
  452.     unsigned char                    csConnectTaggedData;        /* BYTE - tagging data */
  453.     unsigned long                    csConnectFlags;                /* LONGINT - (long) tell us about the connection */
  454.     unsigned long                    csDisplayComponent;            /* LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) */
  455.     unsigned long                    csConnectReserved;            /* LONGINT - (long) reserved */
  456. };
  457. typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec;
  458.  
  459. typedef VDDisplayConnectInfoRec *VDDisplayConnectInfoPtr;
  460.  
  461. struct VDMultiConnectInfoRec {
  462.     unsigned long                     csDisplayCountOrNumber;        /* For GetMultiConnect, returns count n of 1..n connections; otherwise, indicates the ith connection.*/
  463.     VDDisplayConnectInfoRec         csConnectInfo;                /* Standard VDDisplayConnectionInfo for connection i.*/
  464. };
  465. typedef struct VDMultiConnectInfoRec VDMultiConnectInfoRec;
  466.  
  467. typedef VDMultiConnectInfoRec *            VDMultiConnectInfoPtr;
  468.  
  469. /* RawSenseCode
  470.     This abstract data type is not exactly abstract.  Rather, it is merely enumerated constants
  471.     for the possible raw sense code values when 'standard' sense code hardware is implemented.
  472.  
  473.     For 'standard' sense code hardware, the raw sense is obtained as follows:
  474.         • Instruct the frame buffer controller NOT to actively drive any of the monitor sense lines
  475.         • Read the state of the monitor sense lines 2, 1, and 0.  (2 is the MSB, 0 the LSB)
  476.  
  477.     IMPORTANT Note: 
  478.     When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants 
  479.     are valid 'csConnectTaggedType' values in 'VDDisplayConnectInfo' 
  480.  
  481. */
  482. typedef unsigned char RawSenseCode;
  483.  
  484.  
  485. enum {
  486.     kRSCZero                    = 0,
  487.     kRSCOne                        = 1,
  488.     kRSCTwo                        = 2,
  489.     kRSCThree                    = 3,
  490.     kRSCFour                    = 4,
  491.     kRSCFive                    = 5,
  492.     kRSCSix                        = 6,
  493.     kRSCSeven                    = 7
  494. };
  495.  
  496. /* ExtendedSenseCode
  497.     This abstract data type is not exactly abstract.  Rather, it is merely enumerated constants
  498.     for the values which are possible when the extended sense algorithm is applied to hardware
  499.     which implements 'standard' sense code hardware.
  500.  
  501.      For 'standard' sense code hardware, the extended sense code algorithm is as follows:
  502.     (Note:  as described here, sense line 'A' corresponds to '2', 'B' to '1', and 'C' to '0')
  503.         • Drive sense line 'A' low and read the values of 'B' and 'C'.  
  504.         • Drive sense line 'B' low and read the values of 'A' and 'C'.
  505.         • Drive sense line 'C' low and read the values of 'A' and 'B'.
  506.  
  507.     In this way, a six-bit number of the form BC/AC/AB is generated. 
  508.  
  509.     IMPORTANT Note: 
  510.     When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants 
  511.     are valid 'csConnectTaggedData' values in 'VDDisplayConnectInfo' 
  512.  
  513. */
  514. typedef unsigned char ExtendedSenseCode;
  515.  
  516.  
  517. enum {
  518.     kESCZero21Inch                = 0x00,                            /* 21" RGB                                 */
  519.     kESCOnePortraitMono            = 0x14,                            /* Portrait Monochrome                     */
  520.     kESCTwo12Inch                = 0x21,                            /* 12" RGB                                */
  521.     kESCThree21InchRadius        = 0x31,                            /* 21" RGB (Radius)                        */
  522.     kESCThree21InchMonoRadius    = 0x34,                            /* 21" Monochrome (Radius)                 */
  523.     kESCThree21InchMono            = 0x35,                            /* 21" Monochrome                        */
  524.     kESCFourNTSC                = 0x0A,                            /* NTSC                                 */
  525.     kESCFivePortrait            = 0x1E,                            /* Portrait RGB                         */
  526.     kESCSixMSB1                    = 0x03,                            /* MultiScan Band-1 (12" thru 1Six")    */
  527.     kESCSixMSB2                    = 0x0B,                            /* MultiScan Band-2 (13" thru 19")        */
  528.     kESCSixMSB3                    = 0x23,                            /* MultiScan Band-3 (13" thru 21")        */
  529.     kESCSixStandard                = 0x2B,                            /* 13"/14" RGB or 12" Monochrome        */
  530.     kESCSevenPAL                = 0x00,                            /* PAL                                    */
  531.     kESCSevenNTSC                = 0x14,                            /* NTSC                                 */
  532.     kESCSevenVGA                = 0x17,                            /* VGA                                     */
  533.     kESCSeven16Inch                = 0x2D,                            /* 16" RGB (GoldFish)                      */
  534.     kESCSevenPALAlternate        = 0x30,                            /* PAL (Alternate)                         */
  535.     kESCSeven19Inch                = 0x3A,                            /* Third-Party 19”                        */
  536.     kESCSevenNoDisplay            = 0x3F                            /* No display connected                 */
  537. };
  538.  
  539. /* DepthMode
  540.     This abstract data type is used to to reference RELATIVE pixel depths.
  541.     Its definition is largely derived from its past usage, analogous to 'xxxVidMode'
  542.  
  543.     Bits per pixel DOES NOT directly map to 'DepthMode'  For example, on some
  544.     graphics hardware, 'kDepthMode1' may represent 1 BPP, whereas on other
  545.     hardware, 'kDepthMode1' may represent 8BPP.
  546.  
  547.     DepthMode IS considered to be ordinal, i.e., operations such as <, >, ==, etc.
  548.     behave as expected.  The values of the constants which comprise the set are such
  549.     that 'kDepthMode4 < kDepthMode6' behaves as expected.
  550. */
  551. typedef unsigned short DepthMode;
  552.  
  553.  
  554. enum {
  555.     kDepthMode1                    = 128,
  556.     kDepthMode2                    = 129,
  557.     kDepthMode3                    = 130,
  558.     kDepthMode4                    = 131,
  559.     kDepthMode5                    = 132,
  560.     kDepthMode6                    = 133
  561. };
  562.  
  563. enum {
  564.     kFirstDepthMode                = 128,                            /* These constants are obsolete, and just included    */
  565.     kSecondDepthMode            = 129,                            /* for clients that have converted to the above        */
  566.     kThirdDepthMode                = 130,                            /* kDepthModeXXX constants.                            */
  567.     kFourthDepthMode            = 131,
  568.     kFifthDepthMode                = 132,
  569.     kSixthDepthMode                = 133
  570. };
  571.  
  572. struct VDPageInfo {
  573.     short                            csMode;                        /*(word) mode within device*/
  574.     long                            csData;                        /*(long) data supplied by driver*/
  575.     short                            csPage;                        /*(word) page to switch in*/
  576.     Ptr                                csBaseAddr;                    /*(long) base address of page*/
  577. };
  578. typedef struct VDPageInfo VDPageInfo;
  579.  
  580. typedef VDPageInfo *VDPgInfoPtr;
  581.  
  582. struct VDSizeInfo {
  583.     short                            csHSize;                    /*(word) desired/returned h size*/
  584.     short                            csHPos;                        /*(word) desired/returned h position*/
  585.     short                            csVSize;                    /*(word) desired/returned v size*/
  586.     short                            csVPos;                        /*(word) desired/returned v position*/
  587. };
  588. typedef struct VDSizeInfo VDSizeInfo;
  589.  
  590. typedef VDSizeInfo *VDSzInfoPtr;
  591.  
  592. struct VDSettings {
  593.     short                            csParamCnt;                    /*(word) number of params*/
  594.     short                            csBrightMax;                /*(word) max brightness*/
  595.     short                            csBrightDef;                /*(word) default brightness*/
  596.     short                            csBrightVal;                /*(word) current brightness*/
  597.     short                            csCntrstMax;                /*(word) max contrast*/
  598.     short                            csCntrstDef;                /*(word) default contrast*/
  599.     short                            csCntrstVal;                /*(word) current contrast*/
  600.     short                            csTintMax;                    /*(word) max tint*/
  601.     short                            csTintDef;                    /*(word) default tint*/
  602.     short                            csTintVal;                    /*(word) current tint*/
  603.     short                            csHueMax;                    /*(word) max hue*/
  604.     short                            csHueDef;                    /*(word) default hue*/
  605.     short                            csHueVal;                    /*(word) current hue*/
  606.     short                            csHorizDef;                    /*(word) default horizontal*/
  607.     short                            csHorizVal;                    /*(word) current horizontal*/
  608.     short                            csHorizMax;                    /*(word) max horizontal*/
  609.     short                            csVertDef;                    /*(word) default vertical*/
  610.     short                            csVertVal;                    /*(word) current vertical*/
  611.     short                            csVertMax;                    /*(word) max vertical*/
  612. };
  613. typedef struct VDSettings VDSettings;
  614.  
  615. typedef VDSettings *VDSettingsPtr;
  616.  
  617. struct VDDefMode {
  618.     UInt8                            csID;
  619.     SInt8                            filler;
  620. };
  621. typedef struct VDDefMode VDDefMode;
  622.  
  623. typedef VDDefMode *VDDefModePtr;
  624.  
  625. struct VDSyncInfoRec {
  626.     UInt8                            csMode;
  627.     UInt8                            csFlags;
  628. };
  629. typedef struct VDSyncInfoRec VDSyncInfoRec;
  630.  
  631. typedef VDSyncInfoRec *VDSyncInfoPtr;
  632.  
  633. typedef unsigned long DisplayModeID;
  634.  
  635. typedef unsigned long VideoDeviceType;
  636.  
  637. typedef unsigned long GammaTableID;
  638.  
  639. /* Constants for the GetNextResolution call */
  640.  
  641. enum {
  642.     kDisplayModeIDCurrent        = 0x0,                            /* Reference the Current DisplayModeID */
  643.     kDisplayModeIDInvalid        = 0xffffffff,                    /* A bogus DisplayModeID in all cases */
  644.     kDisplayModeIDFindFirstResolution = 0xfffffffe,                /* Used in cscGetNextResolution to reset iterator */
  645.     kDisplayModeIDNoMoreResolutions = 0xfffffffd                /* Used in cscGetNextResolution to indicate End Of List */
  646. };
  647.  
  648. /* Constants for the GetGammaInfoList call */
  649. enum {
  650.     kGammaTableIDFindFirst        = 0xfffffffe,                    /* Get the first gamma table ID */
  651.     kGammaTableIDNoMoreTables    = 0xfffffffd,                    /* Used to indicate end of list */
  652.     kGammaTableIDSpecific        = 0x0                            /* Return the info for the given table id */
  653. };
  654.  
  655. /* Constants for GetMultiConnect call*/
  656. enum {
  657.     kGetConnectionCount            = (long)0xFFFFFFFF,                /* Used to get the number of possible connections in a “multi-headed” framebuffer environment.*/
  658.     kActivateConnection            = (0 << kConnectionInactive),    /* Used for activating a connection (csConnectFlags value).*/
  659.     kDeactivateConnection        = (1 << kConnectionInactive)    /* Used for deactivating a connection (csConnectFlags value.)*/
  660. };
  661.  
  662. struct VDResolutionInfoRec {
  663.     DisplayModeID                    csPreviousDisplayModeID;    /* ID of the previous resolution in a chain */
  664.     DisplayModeID                    csDisplayModeID;            /* ID of the next resolution */
  665.     unsigned long                    csHorizontalPixels;            /* # of pixels in a horizontal line at the max depth */
  666.     unsigned long                    csVerticalLines;            /* # of lines in a screen at the max depth */
  667.     Fixed                            csRefreshRate;                /* Vertical Refresh Rate in Hz */
  668.     DepthMode                        csMaxDepthMode;                /* 0x80-based number representing max bit depth */
  669.     unsigned long                    csResolutionFlags;            /* Reserved - flag bits */
  670.     unsigned long                    csReserved;                    /* Reserved */
  671. };
  672. typedef struct VDResolutionInfoRec VDResolutionInfoRec;
  673.  
  674. typedef VDResolutionInfoRec *VDResolutionInfoPtr;
  675.  
  676. struct VDVideoParametersInfoRec {
  677.     DisplayModeID                    csDisplayModeID;            /* the ID of the resolution we want info on */
  678.     DepthMode                        csDepthMode;                /* The bit depth we want the info on (0x80 based) */
  679.     VPBlockPtr                        csVPBlockPtr;                /* Pointer to a video parameter block */
  680.     unsigned long                    csPageCount;                /* Number of pages supported by the resolution */
  681.     VideoDeviceType                    csDeviceType;                /* Device Type:  Direct, Fixed or CLUT; */
  682.     unsigned long                    csReserved;                    /* Reserved */
  683. };
  684. typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec;
  685.  
  686. typedef VDVideoParametersInfoRec *VDVideoParametersInfoPtr;
  687.  
  688. struct VDGammaInfoRec {
  689.     GammaTableID                    csLastGammaID;                /* the ID of the previous gamma table */
  690.     GammaTableID                    csNextGammaID;                /* the ID of the next gamma table */
  691.     Ptr                                csGammaPtr;                    /* Ptr to a gamma table data */
  692.     unsigned long                    csReserved;                    /* Reserved */
  693. };
  694. typedef struct VDGammaInfoRec VDGammaInfoRec;
  695.  
  696. typedef VDGammaInfoRec *VDGammaInfoPtr;
  697.  
  698. struct VDGetGammaListRec {
  699.     GammaTableID                    csPreviousGammaTableID;        /* ID of the previous gamma table */
  700.     GammaTableID                    csGammaTableID;                /* ID of the gamma table following csPreviousDisplayModeID */
  701.     unsigned long                    csGammaTableSize;            /* Size of the gamma table in bytes */
  702.     char                            *csGammaTableName;            /* Gamma table name (c-string) */
  703. };
  704. typedef struct VDGetGammaListRec VDGetGammaListRec;
  705.  
  706. typedef VDGetGammaListRec *VDGetGammaListPtr;
  707.  
  708. struct VDRetrieveGammaRec {
  709.     GammaTableID                    csGammaTableID;                /* ID of gamma table to retrieve */
  710.     GammaTbl                        *csGammaTablePtr;            /* Location to copy desired gamma to */
  711. };
  712. typedef struct VDRetrieveGammaRec VDRetrieveGammaRec;
  713.  
  714. typedef VDRetrieveGammaRec *VDRetrieveGammaPtr;
  715.  
  716. struct VDSetHardwareCursorRec {
  717.     void                            *csCursorRef;                /* reference to cursor data */
  718.     UInt32                            csReserved1;                /* reserved for future use */
  719.     UInt32                            csReserved2;                /* should be ignored */
  720. };
  721. typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec;
  722.  
  723. typedef VDSetHardwareCursorRec *VDSetHardwareCursorPtr;
  724.  
  725. struct VDDrawHardwareCursorRec {
  726.     SInt32                            csCursorX;                    /* x coordinate */
  727.     SInt32                            csCursorY;                    /* y coordinate */
  728.     UInt32                            csCursorVisible;            /* true if cursor is must be visible */
  729.     UInt32                            csReserved1;                /* reserved for future use */
  730.     UInt32                            csReserved2;                /* should be ignored */
  731. };
  732. typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec;
  733.  
  734. typedef VDDrawHardwareCursorRec *VDDrawHardwareCursorPtr;
  735.  
  736. struct VDSupportsHardwareCursorRec {
  737.     UInt32                            csSupportsHardwareCursor;
  738. /* true if hardware cursor is supported */
  739.     UInt32                            csReserved1;                /* reserved for future use */
  740.     UInt32                            csReserved2;                /* must be zero */
  741. };
  742. typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec;
  743.  
  744. typedef VDSupportsHardwareCursorRec *VDSupportsHardwareCursorPtr;
  745.  
  746. struct VDHardwareCursorDrawStateRec {
  747.     SInt32                            csCursorX;                    /* x coordinate */
  748.     SInt32                            csCursorY;                    /* y coordinate */
  749.     UInt32                            csCursorVisible;            /* true if cursor is visible */
  750.     UInt32                            csCursorSet;                /* true if cursor successfully set by last set control call */
  751.     UInt32                            csReserved1;                /* reserved for future use */
  752.     UInt32                            csReserved2;                /* must be zero */
  753. };
  754. typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec;
  755.  
  756. typedef VDHardwareCursorDrawStateRec *VDHardwareCursorDrawStatePtr;
  757.  
  758. struct VDConvolutionInfoRec {
  759.     DisplayModeID                    csDisplayModeID;            /* the ID of the resolution we want info on */
  760.     DepthMode                        csDepthMode;                /* The bit depth we want the info on (0x80 based) */
  761.     unsigned long                    csPage;
  762.     UInt32                            csFlags;
  763.     UInt32                            csReserved;
  764. };
  765. typedef struct VDConvolutionInfoRec VDConvolutionInfoRec;
  766.  
  767. typedef VDConvolutionInfoRec *VDConvolutionInfoPtr;
  768.  
  769. struct VDPowerStateRec {
  770.     unsigned long                    powerState;
  771.     unsigned long                    powerFlags;
  772.     unsigned long                    powerReserved1;
  773.     unsigned long                    powerReserved2;
  774. };
  775. typedef struct VDPowerStateRec VDPowerStateRec;
  776.  
  777. typedef VDPowerStateRec *VDPowerStatePtr;
  778.  
  779. /*
  780.     Private Data to video drivers.
  781.     
  782.     In versions of MacOS with multiple address spaces (System 8), the OS 
  783.     must know the extent of parameters in order to move them between the caller
  784.     and driver.  The old private-selector model for video drivers does not have
  785.     this information so:
  786.     
  787.     For post-7.x Systems private calls should be implemented using the cscPrivateCall
  788. */
  789. struct VDPrivateSelectorDataRec {
  790.     void *                         privateParameters;            /* Caller's parameters*/
  791.     UInt32                         privateParametersSize;        /* Size of data sent from caller to driver*/
  792.     void *                         privateResults;                /* Caller's return area. Can be nil, or same as privateParameters.*/
  793.     UInt32                         privateResultsSize;            /* Size of data driver returns to caller. Can be nil, or same as privateParametersSize.*/
  794. };
  795. typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec;
  796.  
  797. struct VDPrivateSelectorRec {
  798.     UInt32                             reserved;                    /* Reserved (set to 0). */
  799.     VDPrivateSelectorDataRec         data[1];
  800. };
  801. typedef struct VDPrivateSelectorRec VDPrivateSelectorRec;
  802.  
  803. struct VDDDCBlockRec {
  804.     UInt32                             ddcBlockNumber;                /* Input -- DDC EDID (Extended Display Identification Data) number (1-based) */
  805.     OSType                             ddcBlockType;                /* Input -- DDC block type (EDID/VDIF) */
  806.     UInt32                             ddcFlags;                    /* Input -- DDC Flags*/
  807.     UInt32                             ddcReserved;                /* Reserved */
  808.     UInt8                             ddcBlockData[128];            /* Output -- DDC EDID/VDIF data (kDDCBlockSize) */
  809. };
  810. typedef struct VDDDCBlockRec VDDDCBlockRec;
  811.  
  812. typedef VDDDCBlockRec *                    VDDDCBlockPtr;
  813. typedef UInt32                             VDClutBehavior;
  814. typedef VDClutBehavior *                VDClutBehaviorPtr;
  815.  
  816. enum {
  817.     kSetClutAtSetEntries        = 0,                            /* SetEntries behavior is to update clut during SetEntries call*/
  818.     kSetClutAtVBL                = 1                                /* SetEntries behavior is to upate clut at next vbl*/
  819. };
  820.  
  821.  
  822. #if PRAGMA_IMPORT_SUPPORTED
  823. #pragma import off
  824. #endif
  825.  
  826. #if PRAGMA_ALIGN_SUPPORTED
  827. #pragma options align=reset
  828. #endif
  829.  
  830. #ifdef __cplusplus
  831. }
  832. #endif
  833.  
  834. #endif /* __VIDEO__ */
  835.